package com.lys.enchantment;

import com.lys.ExampleMod;
import com.lys.enchantment.armor.PerseveranceEnchantment;
import com.lys.enchantment.bow.ExplosiveArrowEnchantment;
import com.lys.enchantment.bow.MultiArrowEnchantment;
import com.lys.enchantment.bow.QuickPullingEnchantment;
import com.lys.enchantment.weapon.BloodthirstySwordEnchantment;
import com.lys.enchantment.weapon.LightningAxeEnchantment;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentTarget;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;

import java.util.Set;

public class ModEnchantments {
    public static final Enchantment EXPLOSIVE_ARROW = register("explosive_arrow", new ExplosiveArrowEnchantment(Enchantment.Rarity.COMMON, EquipmentSlot.MAINHAND));

    public static final Enchantment QUICK_PULLING = register("quick_pulling", new QuickPullingEnchantment(Enchantment.Rarity.COMMON, EquipmentSlot.MAINHAND));

    public static final Enchantment MULTI_ARROW = register("multi_arrow", new MultiArrowEnchantment(Enchantment.Rarity.COMMON, EquipmentSlot.MAINHAND));

    public static final Enchantment PERSEVERANCE = register("perseverance", new PerseveranceEnchantment(Enchantment.Rarity.COMMON, EquipmentSlot.HEAD));

    public static final Enchantment BLOODTHIRSTY_SWORD = register("bloodthirsty_sword", new BloodthirstySwordEnchantment(Enchantment.Rarity.COMMON, EquipmentSlot.OFFHAND));

    public static final Enchantment LIGHTNING_AXE = register("lightning_axe", new LightningAxeEnchantment(Enchantment.Rarity.COMMON, EnchantmentTarget.BREAKABLE,EquipmentSlot.MAINHAND));

    public static final Set<Enchantment> Enchantments = Set.of(EXPLOSIVE_ARROW, QUICK_PULLING, MULTI_ARROW,PERSEVERANCE,BLOODTHIRSTY_SWORD,LIGHTNING_AXE);

    private static Enchantment register(String name, Enchantment enchantment) {
        return Registry.register(Registries.ENCHANTMENT, new Identifier(ExampleMod.MOD_ID,name), enchantment);
    }

    // 注册
    public static void registerEnchantments() {
        ExampleMod.LOGGER.info("Registering Enchantments");
    }
}
